import Main from '@/components/main'
import parentView from '@/components/parent-view'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  {
    path: '/lease',
    name: '物品租赁',
    meta: {
      access: ['admin'],
      icon: 'md-funnel',
      title: '物品租赁'
    },
    component: Main,
    children: [
      {
        path: 'Rental',
        name: '物品租赁',
        meta: {
          access: ['admin'],
          icon: 'md-funnel',
          title: '物品租赁'
        },
        component: () => import('@/view/PC/Rental.vue')
      }
    ]
  },
  {
    path: '/sto',
    name: '库存盘点',
    meta: {
      access: ['super_admin'],
      icon: 'md-funnel',
      title: '库存盘点'
    },
    component: Main,
    children: [
      {
        path: 'Stock',
        name: '库存盘点',
        meta: {
          hideInMenu: true,
          icon: 'md-funnel',
          title: '库存盘点'
        },
        component: () => import('@/view/PC/Stock.vue')
      }
    ]
  },

  {
    path: '/',
    redirect: '/lease/Rental',
    name: '租赁管理',
    meta: {
      access: ['super_admin'],
      icon: 'md-menu',
      title: '租赁管理'
    },
    component: Main,
    children: [
      {
        path: 'Rental',
        name: '物品租赁',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '物品租赁'
        },
        component: () => import('@/view/PC/Rental.vue')
      },
      // {
      //   path: 'Price',
      //   name: '租赁标价',
      //   meta: {
      //     icon: 'md-funnel',
      //     title: '租赁标价'
      //   },
      //   component: () => import('@/view/lease/Price.vue')
      // },
      {
        path: 'Business',
        name: '租赁点区域管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '租赁点区域管理'
        },
        component: () => import('@/view/system/Business.vue')
      },
      {
        path: 'Classification',
        name: '租赁物品分类管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '租赁物品分类管理'
        },
        component: () => import('@/view/lease/Classification.vue')
      },
      {
        path: 'Point',
        name: '租赁点管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '租赁点管理'
        },
        component: () => import('@/view/lease/Point.vue')
      },
      {
        path: 'Goods',
        name: '租赁物品管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '租赁物品管理'
        },
        component: () => import('@/view/lease/Goods.vue')
      }
    ]
  },
  {
    path: '/commodity',
    // redirect: '/commodity/Goods',
    name: '商城管理',
    meta: {
      access: ['super_admin'],
      icon: 'md-menu',
      title: '商城管理'
    },
    component: Main,
    children: [

      {
        path: 'Management',
        name: '商品分类管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '商品分类管理'
        },
        component: () => import('@/view/commodity/Management.vue')
      },
      {
        path: 'Goods',
        name: '商品管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '商品管理'
        },
        component: () => import('@/view/commodity/Goods.vue')
      },
      {
        path: 'orders',
        name: '线上订单',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '线上订单'
        },
        component: () => import('@/view/commodity/orders.vue')
      }
    ]
  },
  {
    path: '/store',
    // redirect: '/store/Regional',
    name: '加盟店管理',
    meta: {
      access: ['super_admin'],
      icon: 'md-menu',
      title: '加盟店管理'
    },
    component: Main,
    children: [
      {
        path: 'Merchant',
        name: '加盟店',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '加盟店管理'
        },
        component: () => import('@/view/marketing/Merchant.vue')
      },
      {
        path: 'Regional',
        name: '加盟店区域管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '加盟店区域管理'
        },
        component: () => import('@/view/system/Regional.vue')
      }
    ]
  },
  {
    path: '/marketing',
    // redirect: '/marketing/Membership',
    name: '会员营销',
    meta: {
      access: ['super_admin'],
      icon: 'md-menu',
      title: '会员营销'
    },
    component: Main,
    children: [
      // {
      //   path: 'Membership',
      //   name: '会员管理',
      //   meta: {
      //     icon: 'md-funnel',
      //     title: '会员管理'
      //   },
      //   component: () => import('@/view/marketing/Membership.vue')
      // },
      // {
      //   path: 'Classification',
      //   name: '商户分类管理',
      //   meta: {
      //     access: ['super_admin'],
      //     icon: 'md-funnel',
      //     title: '商户分类管理'
      //   },
      //   component: () => import('@/view/system/Classification.vue')
      // },
      // {
      //   path: 'Regional',
      //   name: '商户区域管理',
      //   meta: {
      //     access: ['super_admin'],
      //     icon: 'md-funnel',
      //     title: '商户区域管理'
      //   },
      //   component: () => import('@/view/system/Regional.vue')
      // },
      // {
      //   path: 'Merchant',
      //   name: '商户管理',
      //   meta: {
      //     access: ['super_admin'],
      //     icon: 'md-funnel',
      //     title: '商户管理'
      //   },
      //   component: () => import('@/view/marketing/Merchant.vue')
      // },
      {
        path: 'Coupon',
        name: '点金券管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '点金券管理'
        },
        component: () => import('@/view/marketing/Coupon.vue')
      },
      {
        path: 'couponList',
        name: '点金券消费统计',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '点金券消费统计'
        },
        component: () => import('@/view/marketing/couponList.vue')
      },
      {
        path: 'couponDetail',
        name: '点金券记录',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '点金券记录'
        },
        component: () => import('@/view/marketing/couponDetail.vue')
      },
      {
        path: 'proportion',
        name: '积分比例/点金券比例',
        meta: {
          icon: 'md-funnel',
          title: '积分比例/点金券比例'
        },
        component: () => import('@/view/marketing/Proportion.vue')
      }
    ]
  },
  {
    path: '/sys',
    name: '系统管理',
    meta: {
      icon: 'md-menu',
      showAlways: true,
      access: ['super_admin'],
      title: '系统管理'
    },
    component: Main,
    children: [
      {
        path: 'Account',
        name: '账户管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '账户管理'
        },
        component: () => import('@/view/basic/Account.vue')
      },
      {
        path: 'Role',
        name: '角色管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '角色管理'
        },
        component: () => import('@/view/basic/Role.vue')
      },
      {
        path: 'vips',
        name: '会员管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '会员管理'
        },
        component: () => import('@/view/basic/vips.vue')
      },
      {
        path: 'Classification',
        name: '商户分类管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '商户分类管理'
        },
        component: () => import('@/view/system/Classification.vue')
      },
    ]
  },
  // {
  //   path: '/argu',
  //   name: 'argu',
  //   meta: {
  //     hideInMenu: true
  //   },
  //   component: Main,
  //   children: [
  //     {
  //       path: 'params/:id',
  //       name: 'params',
  //       meta: {
  //         icon: 'md-flower',
  //         title: route => `{{ params }}-${route.params.id}`,
  //         notCache: true,
  //         beforeCloseName: 'before_close_normal'
  //       },
  //       component: () => import('@/view/argu-page/params.vue')
  //     },
  //     {
  //       path: 'query',
  //       name: 'query',
  //       meta: {
  //         icon: 'md-flower',
  //         title: route => `{{ query }}-${route.query.id}`,
  //         notCache: true
  //       },
  //       component: () => import('@/view/argu-page/query.vue')
  //     }
  //   ]
  // },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  },
  {
    path: '/activityM',
    redirect: '/activityM/activity',
    name: '活动管理模块',
    meta: {
      access: ['super_admin'],
      icon: 'md-menu',
      title: '活动管理模块'
    },
    component: Main,
    children: [
      {
        path: 'activity',
        name: '活动管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '活动管理'
        },
        component: () => import('@/view/activityM/activity.vue')
      }
    ]
  },
  {
    path: '/activityM',
    redirect: '/activityM/banner',
    name: '轮播图管理',
    meta: {
      access: ['super_admin'],
      icon: 'md-menu',
      title: '轮播图管理'
    },
    component: Main,
    children: [
      {
        path: 'banner',
        name: '轮播图管理',
        meta: {
          access: ['super_admin'],
          icon: 'md-funnel',
          title: '轮播图管理'
        },
        component: () => import('@/view/activityM/banner.vue')
      }
    ]
  }
]
